/*     */ package btsm.servlet;
/*     */ 
/*     */ import btsm.bean.sqlBTSWork;
/*     */ import java.io.IOException;
/*     */ import java.io.PrintStream;
/*     */ import javax.servlet.RequestDispatcher;
/*     */ import javax.servlet.ServletException;
/*     */ import javax.servlet.http.HttpServlet;
/*     */ import javax.servlet.http.HttpServletRequest;
/*     */ import javax.servlet.http.HttpServletResponse;
/*     */ 
/*     */ public class ser_FaultBTS extends HttpServlet
/*     */ {
/*     */   public void init()
/*     */     throws ServletException
/*     */   {
/*     */   }
/*     */ 
/*     */   public void doGet(HttpServletRequest request, HttpServletResponse response)
/*     */     throws ServletException, IOException
/*     */   {
/*  23 */     sqlBTSWork PC = new sqlBTSWork("malfunction", "1");
/*     */ 
/*  25 */     String seraction = request.getParameter("seraction");
/*  26 */     String strbtscode = request.getParameter("btscode");
/*  27 */     String strbtsname = request.getParameter("btsname");
/*  28 */     String strsnid = request.getParameter("snid");
/*  29 */     String strToPage = request.getParameter("ToPage");
/*  30 */     if (strToPage == null) {
/*  31 */       strToPage = request.getParameter("tToPage");
/*     */     }
/*  33 */     strbtsname = new String(strbtsname.getBytes("ISO8859-1"), "UTF-8");
/*  34 */     System.out.println("serFaultBTS:strbtsname:" + strbtsname);
/*     */ 
/*  37 */     if (seraction.equalsIgnoreCase("serinsertsimple"))
/*     */     {
/*  40 */       boolean result = PC.insertsimple(strbtscode, strbtsname);
/*  41 */       if (result) {
/*  42 */         String msg = "";
/*  43 */         msg = msg + "新建基站故障成功";
/*  44 */         request.setAttribute("msg", msg);
/*  45 */         request.setAttribute("filesnames", "ser_FaultBTS?seraction=sermodp&btscode=" + strbtscode + "&btsname=" + strbtsname);
/*     */ 
/*  47 */         RequestDispatcher btsm = request.getRequestDispatcher("common.jsp");
/*  48 */         btsm.forward(request, response);
/*     */       }
/*     */       else {
/*  51 */         String msg = "";
/*  52 */         msg = msg + "新建基站故障失败";
/*  53 */         request.setAttribute("msg", msg);
/*  54 */         request.setAttribute("filesnames", "ser_FaultBTS?seraction=sermodp&btscode=" + strbtscode + "&btsname=" + strbtsname);
/*     */ 
/*  56 */         RequestDispatcher btsm = request.getRequestDispatcher("common.jsp");
/*  57 */         btsm.forward(request, response);
/*     */       }
/*     */     }
/*  60 */     else if (seraction.equalsIgnoreCase("sermodp"))
/*     */     {
/*  62 */       request.setAttribute("btscode", strbtscode);
/*  63 */       request.setAttribute("snid", strsnid);
/*  64 */       request.setAttribute("ToPage", strToPage);
/*  65 */       System.out.println("strToPageLGMODP:" + strToPage);
/*  66 */       if (strToPage == null)
/*  67 */         strToPage = "1";
/*  68 */       RequestDispatcher btsm = request.getRequestDispatcher("nnadd_FaultBTS.jsp?ToPage=" + strToPage + "&btsname=" + strbtsname);
/*  69 */       btsm.forward(request, response);
/*  70 */     } else if (seraction.equals("serdel"))
/*     */     {
/*  72 */       request.setAttribute("filesnames", "ser_FaultBTS?seraction=sermodp&btscode=" + strbtscode + "&btsname=" + strbtsname);
/*  73 */       request.setAttribute("btscode", strbtscode);
/*     */ 
/*  75 */       boolean result = PC.delbyid(strsnid);
/*  76 */       if (result) {
/*  77 */         String msg = "";
/*  78 */         msg = msg + "基站故障信息删除成功";
/*  79 */         request.setAttribute("msg", msg);
/*     */ 
/*  81 */         RequestDispatcher btsm = request.getRequestDispatcher("common.jsp");
/*  82 */         btsm.forward(request, response);
/*     */       } else {
/*  84 */         String msg = "";
/*  85 */         msg = msg + "基站故障删除失败";
/*  86 */         request.setAttribute("msg", msg);
/*     */ 
/*  88 */         RequestDispatcher btsm = request.getRequestDispatcher("common.jsp");
/*  89 */         btsm.forward(request, response);
/*     */       }
/*     */     }
/*  92 */     else if (seraction.equals("sermod"))
/*     */     {
/*  96 */       PC.wheresw = strsnid;
/*  97 */       String[] fieldxg = request.getParameterValues("T1");
/*  98 */       boolean result = PC.mdByID(fieldxg, strsnid);
/*  99 */       if (result) {
/* 100 */         String msg = "";
/* 101 */         msg = msg + "基站故障信息修改成功";
/* 102 */         request.setAttribute("msg", msg);
/* 103 */         request.setAttribute("filesnames", "ser_FaultBTS?seraction=sermodp&btscode=" + strbtscode + "&snid=" + strsnid + "&ToPage=" + strToPage + "&btsname=" + strbtsname);
/* 104 */         request.setAttribute("btscode", strbtscode);
/* 105 */         request.setAttribute("ToPage", strToPage);
/*     */ 
/* 107 */         RequestDispatcher btsm = request.getRequestDispatcher("common.jsp");
/* 108 */         btsm.forward(request, response);
/*     */       } else {
/* 110 */         String msg = "";
/* 111 */         msg = msg + "基站故障修改失败";
/* 112 */         request.setAttribute("msg", msg);
/* 113 */         request.setAttribute("filesnames", "ser_FaultBTS?seraction=sermodp&btscode=" + strbtscode + "&snid=" + strsnid + "&ToPage=" + strToPage + "&btsname=" + strbtsname);
/* 114 */         request.setAttribute("btscode", strbtscode);
/* 115 */         request.setAttribute("ToPage", strToPage);
/*     */ 
/* 117 */         RequestDispatcher btsm = request.getRequestDispatcher("common.jsp");
/* 118 */         btsm.forward(request, response);
/*     */       }
/*     */     }
/*     */   }
/*     */ 
/*     */   public void doPost(HttpServletRequest request, HttpServletResponse response)
/*     */     throws ServletException, IOException
/*     */   {
/* 126 */     doGet(request, response);
/*     */   }
/*     */ 
/*     */   public void destroy()
/*     */   {
/*     */   }
/*     */ }

/* Location:           E:\java\apache-tomcat-6.0.36\webapps\btsm\WEB-INF\classes\
 * Qualified Name:     btsm.servlet.ser_FaultBTS
 * JD-Core Version:    0.6.2
 */